<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- 公共头部部分 -->
<jsp:include page="_header.jsp"></jsp:include>
<!-- end -->
<title>班级列表</title>
<style>
	.modal-body>div{
		margin-bottom: 10px;
		margin-right:30px;
		float: left;
	}
	.inp{
		width: 150px;
	}
	.modal-footer:AFTER{
		
	}
</style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 班级管理 <span class="c-gray en">&gt;</span> 班级列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c">
		<form action="${pageContext.request.contextPath }/educClassRoom/index" method="post">
			<span class="select-box inline">
			<%-- <select name="courseClassGrade" class="select">
				<option value="0">全部年级</option>
				<c:forEach var="gr" items="${grlist }">
					<option value="${gr.grade_id }">${gr.grade_name }</option>
				</c:forEach>
			</select> --%>
			</span>
			<input type="text" name="cxName" value="${cxName }" id="" placeholder=" 教室名称" style="width:250px" class="input-text">
			<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜教室</button>
		</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="l">
			<a href="javascript:;"  onclick="datadel_list('educCourseClass')" class="btn btn-danger radius">
				<i class="Hui-iconfont">&#xe6e2;</i> 批量删除
			</a> 
			<a class="btn btn-primary radius" data-title="添加班级" onClick="article_edit('添加班级','${pageContext.request.contextPath }/educCourseClass/updateIndex?pageText=1&id=${cc.class_id }',${cc.class_id })" href="javascript:;">
				<i class="Hui-iconfont">&#xe600;</i> 添加班级
			</a>
		</span> 
		<span class="r">共有数据：<strong>${page.totalCount }</strong> 条</span> 
		</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
			<thead>
				<tr class="text-c">
					<th width="25">
						<input type="checkbox" name="" value="">
					</th>
					<th width="80">ID</th>
					<th>班级名称</th>
					<th width="80">所属年级</th>
					<th width="80">班级人数</th>
					<!-- <th width="80">来源</th>
					<th width="120">更新时间</th>
					<th width="75">浏览次数</th>
					<th width="60">发布状态</th> -->
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="cc" items="${list}">
					<tr class="text-c">
					<td><input type="checkbox" value="${cc.class_id }" name="message"></td>
					<td>${cc.class_id }</td>
					<td>${cc.class_name }</td>
					<td>${cc.grade_name }</td>
					<td>${cc.class_number }</td>
					<td  width="150" class="f-14 td-manage">
						<!-- <a style="text-decoration:none" onClick="article_shenhe(this,'10001')" href="javascript:;" title="审核">审核</a> -->
						<a style="text-decoration:none" class="ml-5" onClick="article_edit('教员编辑','${pageContext.request.contextPath }/educCourseClass/updateIndex?pageText=2&id=${cc.class_id }',${cc.class_id })" href="javascript:;" title="编辑">
							<i class="Hui-iconfont">&#xe6df;</i>
						</a> 
						<a style="text-decoration:none" class="ml-5" onClick="article_del(this,${cc.class_id},'educCourseClass')" href="javascript:;" title="删除">
							<i class="Hui-iconfont">&#xe6e2;</i>
						</a>
						<a class="btn btn-default radius" data-title="预排课" data-toggle="modal" data-target="#myModal" onclick="courseClick('${cc.class_name }')" href="javascript:;">
							 预排课
						</a>
					</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h5>预排课</h5>
					</div>
					<div class="modal-body">
						<div>
							排课时间：<input type="text" onfocus="WdatePicker()" value="" placeholder="开始时间 " id="ctStartDate" name="ctStartDate" class="input-text Wdate" style="width:220px;">
								-- <input type="text" onfocus="WdatePicker()" value="" placeholder="结束时间" id="ctStopDate" name="ctStopDate" class="input-text Wdate" style="width:220px;">
						</div>
						<div>
							班级名称：<input type="text" class="input-text inp" disabled="disabled" value="" placeholder="" id="class_name" name="class_name">
						</div>
						<div>
							教室名称：<input type="text" class="input-text inp" value="" placeholder="" id="classRoom_name" name="classRoom_name">
						</div>
						<div>
							排课次数：<input type="text" class="input-text inp" value="" placeholder="" id="courseNumber" name="courseNumber">
						</div>
						<div>
							教师姓名：<input type="text" class="input-text inp" value="" placeholder="" id="teacher_name" name="teacher_name">
						</div>
						<div>
							有效时段：<input type="text" class="input-text inp" value="" placeholder="" id="effectiveDate" name="effectiveDate">
						</div>
						<div>
							间隔时段：<input type="text" class="input-text inp" value="" placeholder="" id="intervalDate" name="intervalDate">
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭
						</button>
						<button type="button" class="btn btn-primary">
							完成
						</button>
					</div>
				</div>
			</div>
		</div>
		<nav class="breadcrumb" style="background: #fff;">
			当前页数:${page.currentPageNo } 共 ${page.totalPageCount } 页
			<c:if test="${page.currentPageNo < page.totalPageCount }">
				<a class="btn radius r" style="line-height: 1.6em; margin-top: 3px"
					href="${pageContext.request.contextPath }/educCourseClass/index?cxName=${cxName }&currentPageNo=${page.totalPageCount }">尾页</a>
				<a class="btn radius r" style="line-height: 1.6em; margin-top: 3px"
					href="${pageContext.request.contextPath }/educCourseClass/index?cxName=${cxName }&currentPageNo=${page.currentPageNo+1 }">下一页</a>
			</c:if>
			<c:if test="${page.currentPageNo > 1}">
				<a class="btn radius r" style="line-height: 1.6em; margin-top: 3px"
					href="${pageContext.request.contextPath }/educCourseClass/index?cxName=${cxName }&currentPageNo=${page.currentPageNo-1 }">上一页</a>
				<a class="btn radius r" style="line-height: 1.6em; margin-top: 3px"
					href="${pageContext.request.contextPath }/educCourseClass/index?cxName=${cxName }&currentPageNo=1">首页</a>
			</c:if>
		</nav>
	</div>
</div>
<!-- 公共页脚部分 -->
<jsp:include page="_footer.jsp"></jsp:include>
<!-- end -->
<script type="text/javascript">
function courseClick(className){
	$("#class_name").val(className);
	var now = new Date(); 
	var nowTime = now.getTime() ; 
	var day = now.getDay();
	var oneDayLong = 24*60*60*1000 ; 
	var MondayTime = nowTime - (day-1)*oneDayLong  ; 
	var SaturdayTime =  nowTime + (6-day)*oneDayLong ; 
	var monday = new Date(MondayTime);
	var saturday = new Date(SaturdayTime);
	var date1=monday.getFullYear()+"-"+monday.getMonth()+"-"+monday.getDate()+"  (周一)";
	var date2=saturday.getFullYear()+"-"+monday.getMonth()+"-"+monday.getDate()+"  (周六)";
	$("#ctStartDate").val(date1);
	$("#ctStopDate").val(date2);
};
</script>